/*
 * @Author: tanjunyi@doctorwork.com
 * @Date: 2020-04-09 13:22:42
 * @LastEditors: tanjunyi@doctorwork.com
 * @LastEditTime: 2020-05-03 15:17:31
 * @Description:
 */
//  ----------------------
'use strict';
// var mobx = require('mobx');
var mobx = require('./mobx');
const { Reaction, observable, autorun, action } = mobx;
let equalArr = []
let runObj = observable({
	num: 12, grad: 3, doctorwork: {
		clinicList: {
			currentCity: 11

		}
	}
});
equalArr = [];
let reaction = new Reaction('test Reaction', function () {
	this.track(() => {
		console.log('@@runObj.num: ', runObj.num);
		console.log('@@runObj.doctorwork.doctor: ', runObj.doctorwork.clinicList.currentCity);
		equalArr.push(runObj.num)
	})

})
reaction.track(() => {
	console.log('runObj.doctorwork.doctor: ', runObj.doctorwork.clinicList.currentCity);
	console.log('runObj.num: ', runObj.num);
	equalArr.push(runObj.num)
})

runObj.doctorwork.clinicList.currentCity++
runObj.doctorwork.clinicList.currentCity++
runObj.num++;
console.log(JSON.stringify(equalArr))
